import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/hazard_facility_entity.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/device_detection_entity.dart';


HazardFacilityEntity $HazardFacilityEntityFromJson(Map<String, dynamic> json) {
  final HazardFacilityEntity hazardFacilityEntity = HazardFacilityEntity();
  final String? backupLinkAddress = jsonConvert.convert<String>(json['backupLinkAddress']);
  if (backupLinkAddress != null) {
    hazardFacilityEntity.backupLinkAddress = backupLinkAddress;
  }
  final String? buildDate = jsonConvert.convert<String>(json['buildDate']);
  if (buildDate != null) {
    hazardFacilityEntity.buildDate = buildDate;
  }
  final String? bypassSwitchTotalLocaleNo = jsonConvert.convert<String>(json['bypassSwitchTotalLocaleNo']);
  if (bypassSwitchTotalLocaleNo != null) {
    hazardFacilityEntity.bypassSwitchTotalLocaleNo = bypassSwitchTotalLocaleNo;
  }
  final String? chemicalProcessTypeDicId = jsonConvert.convert<String>(json['chemicalProcessTypeDicId']);
  if (chemicalProcessTypeDicId != null) {
    hazardFacilityEntity.chemicalProcessTypeDicId = chemicalProcessTypeDicId;
  }
  final String? chemicalProcessTypeDicIdLabel = jsonConvert.convert<String>(json['chemicalProcessTypeDicIdLabel']);
  if (chemicalProcessTypeDicIdLabel != null) {
    hazardFacilityEntity.chemicalProcessTypeDicIdLabel = chemicalProcessTypeDicIdLabel;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    hazardFacilityEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    hazardFacilityEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    hazardFacilityEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    hazardFacilityEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    hazardFacilityEntity.deleted = deleted;
  }
  final double? designReserve = jsonConvert.convert<double>(json['designReserve']);
  if (designReserve != null) {
    hazardFacilityEntity.designReserve = designReserve;
  }
  final List<DeviceDetectionEntity>? deviceDetectionList = (json['deviceDetectionList'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<DeviceDetectionEntity>(e) as DeviceDetectionEntity).toList();
  if (deviceDetectionList != null) {
    hazardFacilityEntity.deviceDetectionList = deviceDetectionList;
  }
  final String? equipCode = jsonConvert.convert<String>(json['equipCode']);
  if (equipCode != null) {
    hazardFacilityEntity.equipCode = equipCode;
  }
  final String? equipDescribe = jsonConvert.convert<String>(json['equipDescribe']);
  if (equipDescribe != null) {
    hazardFacilityEntity.equipDescribe = equipDescribe;
  }
  final String? equipLevel = jsonConvert.convert<String>(json['equipLevel']);
  if (equipLevel != null) {
    hazardFacilityEntity.equipLevel = equipLevel;
  }
  final String? equipLevelLabel = jsonConvert.convert<String>(json['equipLevelLabel']);
  if (equipLevelLabel != null) {
    hazardFacilityEntity.equipLevelLabel = equipLevelLabel;
  }
  final String? equipName = jsonConvert.convert<String>(json['equipName']);
  if (equipName != null) {
    hazardFacilityEntity.equipName = equipName;
  }
  final String? equipStatus = jsonConvert.convert<String>(json['equipStatus']);
  if (equipStatus != null) {
    hazardFacilityEntity.equipStatus = equipStatus;
  }
  final String? equipTypeDicId = jsonConvert.convert<String>(json['equipTypeDicId']);
  if (equipTypeDicId != null) {
    hazardFacilityEntity.equipTypeDicId = equipTypeDicId;
  }
  final String? equipTypeDicIdLabel = jsonConvert.convert<String>(json['equipTypeDicIdLabel']);
  if (equipTypeDicIdLabel != null) {
    hazardFacilityEntity.equipTypeDicIdLabel = equipTypeDicIdLabel;
  }
  final double? floorArea = jsonConvert.convert<double>(json['floorArea']);
  if (floorArea != null) {
    hazardFacilityEntity.floorArea = floorArea;
  }
  final String? hazardCode = jsonConvert.convert<String>(json['hazardCode']);
  if (hazardCode != null) {
    hazardFacilityEntity.hazardCode = hazardCode;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    hazardFacilityEntity.id = id;
  }
  final double? doubleerlockingCount = jsonConvert.convert<double>(json['doubleerlockingCount']);
  if (doubleerlockingCount != null) {
    hazardFacilityEntity.doubleerlockingCount = doubleerlockingCount;
  }
  final String? latitude = jsonConvert.convert<String>(json['latitude']);
  if (latitude != null) {
    hazardFacilityEntity.latitude = latitude;
  }
  final double? liquidLevel = jsonConvert.convert<double>(json['liquidLevel']);
  if (liquidLevel != null) {
    hazardFacilityEntity.liquidLevel = liquidLevel;
  }
  final String? longitude = jsonConvert.convert<String>(json['longitude']);
  if (longitude != null) {
    hazardFacilityEntity.longitude = longitude;
  }
  final String? mainSwitchStatusLocaleNo = jsonConvert.convert<String>(json['mainSwitchStatusLocaleNo']);
  if (mainSwitchStatusLocaleNo != null) {
    hazardFacilityEntity.mainSwitchStatusLocaleNo = mainSwitchStatusLocaleNo;
  }
  final String? maintenanceDate = jsonConvert.convert<String>(json['maintenanceDate']);
  if (maintenanceDate != null) {
    hazardFacilityEntity.maintenanceDate = maintenanceDate;
  }
  final String? manLinkAddress = jsonConvert.convert<String>(json['manLinkAddress']);
  if (manLinkAddress != null) {
    hazardFacilityEntity.manLinkAddress = manLinkAddress;
  }
  final String? medium = jsonConvert.convert<String>(json['medium']);
  if (medium != null) {
    hazardFacilityEntity.medium = medium;
  }
  final String? mediumStatusDicId = jsonConvert.convert<String>(json['mediumStatusDicId']);
  if (mediumStatusDicId != null) {
    hazardFacilityEntity.mediumStatusDicId = mediumStatusDicId;
  }
  final String? mediumStatusDicIdLabel = jsonConvert.convert<String>(json['mediumStatusDicIdLabel']);
  if (mediumStatusDicIdLabel != null) {
    hazardFacilityEntity.mediumStatusDicIdLabel = mediumStatusDicIdLabel;
  }
  final String? monitorGas = jsonConvert.convert<String>(json['monitorGas']);
  if (monitorGas != null) {
    hazardFacilityEntity.monitorGas = monitorGas;
  }
  final String? monitorGasLabel = jsonConvert.convert<String>(json['monitorGasLabel']);
  if (monitorGasLabel != null) {
    hazardFacilityEntity.monitorGasLabel = monitorGasLabel;
  }
  final String? monitorTypeDicId = jsonConvert.convert<String>(json['monitorTypeDicId']);
  if (monitorTypeDicId != null) {
    hazardFacilityEntity.monitorTypeDicId = monitorTypeDicId;
  }
  final String? monitorTypeDicIdLabel = jsonConvert.convert<String>(json['monitorTypeDicIdLabel']);
  if (monitorTypeDicIdLabel != null) {
    hazardFacilityEntity.monitorTypeDicIdLabel = monitorTypeDicIdLabel;
  }
  final double? pressureDesign = jsonConvert.convert<double>(json['pressureDesign']);
  if (pressureDesign != null) {
    hazardFacilityEntity.pressureDesign = pressureDesign;
  }
  final double? pressureMax = jsonConvert.convert<double>(json['pressureMax']);
  if (pressureMax != null) {
    hazardFacilityEntity.pressureMax = pressureMax;
  }
  final String? pressureTypeDicId = jsonConvert.convert<String>(json['pressureTypeDicId']);
  if (pressureTypeDicId != null) {
    hazardFacilityEntity.pressureTypeDicId = pressureTypeDicId;
  }
  final String? pressureTypeDicIdLabel = jsonConvert.convert<String>(json['pressureTypeDicIdLabel']);
  if (pressureTypeDicIdLabel != null) {
    hazardFacilityEntity.pressureTypeDicIdLabel = pressureTypeDicIdLabel;
  }
  final String? ptInfo = jsonConvert.convert<String>(json['ptInfo']);
  if (ptInfo != null) {
    hazardFacilityEntity.ptInfo = ptInfo;
  }
  final double? reserves = jsonConvert.convert<double>(json['reserves']);
  if (reserves != null) {
    hazardFacilityEntity.reserves = reserves;
  }
  final String? riskObjectId = jsonConvert.convert<String>(json['riskObjectId']);
  if (riskObjectId != null) {
    hazardFacilityEntity.riskObjectId = riskObjectId;
  }
  final String? startDate = jsonConvert.convert<String>(json['startDate']);
  if (startDate != null) {
    hazardFacilityEntity.startDate = startDate;
  }
  final String? storeTypeDicId = jsonConvert.convert<String>(json['storeTypeDicId']);
  if (storeTypeDicId != null) {
    hazardFacilityEntity.storeTypeDicId = storeTypeDicId;
  }
  final String? storeTypeDicIdLabel = jsonConvert.convert<String>(json['storeTypeDicIdLabel']);
  if (storeTypeDicIdLabel != null) {
    hazardFacilityEntity.storeTypeDicIdLabel = storeTypeDicIdLabel;
  }
  final String? tankTypeDicId = jsonConvert.convert<String>(json['tankTypeDicId']);
  if (tankTypeDicId != null) {
    hazardFacilityEntity.tankTypeDicId = tankTypeDicId;
  }
  final String? tankTypeDicIdLabel = jsonConvert.convert<String>(json['tankTypeDicIdLabel']);
  if (tankTypeDicIdLabel != null) {
    hazardFacilityEntity.tankTypeDicIdLabel = tankTypeDicIdLabel;
  }
  final double? temperatureMax = jsonConvert.convert<double>(json['temperatureMax']);
  if (temperatureMax != null) {
    hazardFacilityEntity.temperatureMax = temperatureMax;
  }
  final double? temperatureMin = jsonConvert.convert<double>(json['temperatureMin']);
  if (temperatureMin != null) {
    hazardFacilityEntity.temperatureMin = temperatureMin;
  }
  final String? temperatureTypeDicId = jsonConvert.convert<String>(json['temperatureTypeDicId']);
  if (temperatureTypeDicId != null) {
    hazardFacilityEntity.temperatureTypeDicId = temperatureTypeDicId;
  }
  final String? temperatureTypeDicIdLabel = jsonConvert.convert<String>(json['temperatureTypeDicIdLabel']);
  if (temperatureTypeDicIdLabel != null) {
    hazardFacilityEntity.temperatureTypeDicIdLabel = temperatureTypeDicIdLabel;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    hazardFacilityEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    hazardFacilityEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    hazardFacilityEntity.updateDate = updateDate;
  }
  final String? useDate = jsonConvert.convert<String>(json['useDate']);
  if (useDate != null) {
    hazardFacilityEntity.useDate = useDate;
  }
  final List<String>? filePath = (json['filePath'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (filePath != null) {
    hazardFacilityEntity.filePath = filePath;
  }
  final String? isPressureVessel = jsonConvert.convert<String>(json['isPressureVessel']);
  if (isPressureVessel != null) {
    hazardFacilityEntity.isPressureVessel = isPressureVessel;
  }
  final String? havePressurePipeline = jsonConvert.convert<String>(json['havePressurePipeline']);
  if (havePressurePipeline != null) {
    hazardFacilityEntity.havePressurePipeline = havePressurePipeline;
  }
  final String? isBoiler = jsonConvert.convert<String>(json['isBoiler']);
  if (isBoiler != null) {
    hazardFacilityEntity.isBoiler = isBoiler;
  }
  final int? interlockingCount = jsonConvert.convert<int>(json['interlockingCount']);
  if (interlockingCount != null) {
    hazardFacilityEntity.interlockingCount = interlockingCount;
  }
  return hazardFacilityEntity;
}

Map<String, dynamic> $HazardFacilityEntityToJson(HazardFacilityEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['backupLinkAddress'] = entity.backupLinkAddress;
  data['buildDate'] = entity.buildDate;
  data['bypassSwitchTotalLocaleNo'] = entity.bypassSwitchTotalLocaleNo;
  data['chemicalProcessTypeDicId'] = entity.chemicalProcessTypeDicId;
  data['chemicalProcessTypeDicIdLabel'] = entity.chemicalProcessTypeDicIdLabel;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['designReserve'] = entity.designReserve;
  data['deviceDetectionList'] = entity.deviceDetectionList?.map((v) => v.toJson()).toList();
  data['equipCode'] = entity.equipCode;
  data['equipDescribe'] = entity.equipDescribe;
  data['equipLevel'] = entity.equipLevel;
  data['equipLevelLabel'] = entity.equipLevelLabel;
  data['equipName'] = entity.equipName;
  data['equipStatus'] = entity.equipStatus;
  data['equipTypeDicId'] = entity.equipTypeDicId;
  data['equipTypeDicIdLabel'] = entity.equipTypeDicIdLabel;
  data['floorArea'] = entity.floorArea;
  data['hazardCode'] = entity.hazardCode;
  data['id'] = entity.id;
  data['doubleerlockingCount'] = entity.doubleerlockingCount;
  data['latitude'] = entity.latitude;
  data['liquidLevel'] = entity.liquidLevel;
  data['longitude'] = entity.longitude;
  data['mainSwitchStatusLocaleNo'] = entity.mainSwitchStatusLocaleNo;
  data['maintenanceDate'] = entity.maintenanceDate;
  data['manLinkAddress'] = entity.manLinkAddress;
  data['medium'] = entity.medium;
  data['mediumStatusDicId'] = entity.mediumStatusDicId;
  data['mediumStatusDicIdLabel'] = entity.mediumStatusDicIdLabel;
  data['monitorGas'] = entity.monitorGas;
  data['monitorGasLabel'] = entity.monitorGasLabel;
  data['monitorTypeDicId'] = entity.monitorTypeDicId;
  data['monitorTypeDicIdLabel'] = entity.monitorTypeDicIdLabel;
  data['pressureDesign'] = entity.pressureDesign;
  data['pressureMax'] = entity.pressureMax;
  data['pressureTypeDicId'] = entity.pressureTypeDicId;
  data['pressureTypeDicIdLabel'] = entity.pressureTypeDicIdLabel;
  data['ptInfo'] = entity.ptInfo;
  data['reserves'] = entity.reserves;
  data['riskObjectId'] = entity.riskObjectId;
  data['startDate'] = entity.startDate;
  data['storeTypeDicId'] = entity.storeTypeDicId;
  data['storeTypeDicIdLabel'] = entity.storeTypeDicIdLabel;
  data['tankTypeDicId'] = entity.tankTypeDicId;
  data['tankTypeDicIdLabel'] = entity.tankTypeDicIdLabel;
  data['temperatureMax'] = entity.temperatureMax;
  data['temperatureMin'] = entity.temperatureMin;
  data['temperatureTypeDicId'] = entity.temperatureTypeDicId;
  data['temperatureTypeDicIdLabel'] = entity.temperatureTypeDicIdLabel;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['useDate'] = entity.useDate;
  data['filePath'] = entity.filePath;
  data['isPressureVessel'] = entity.isPressureVessel;
  data['havePressurePipeline'] = entity.havePressurePipeline;
  data['isBoiler'] = entity.isBoiler;
  data['interlockingCount'] = entity.interlockingCount;
  return data;
}

extension HazardFacilityEntityExtension on HazardFacilityEntity {
  HazardFacilityEntity copyWith({
    String? backupLinkAddress,
    String? buildDate,
    String? bypassSwitchTotalLocaleNo,
    String? chemicalProcessTypeDicId,
    String? chemicalProcessTypeDicIdLabel,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    double? designReserve,
    List<DeviceDetectionEntity>? deviceDetectionList,
    String? equipCode,
    String? equipDescribe,
    String? equipLevel,
    String? equipLevelLabel,
    String? equipName,
    String? equipStatus,
    String? equipTypeDicId,
    String? equipTypeDicIdLabel,
    double? floorArea,
    String? hazardCode,
    String? id,
    double? doubleerlockingCount,
    String? latitude,
    double? liquidLevel,
    String? longitude,
    String? mainSwitchStatusLocaleNo,
    String? maintenanceDate,
    String? manLinkAddress,
    String? medium,
    String? mediumStatusDicId,
    String? mediumStatusDicIdLabel,
    String? monitorGas,
    String? monitorGasLabel,
    String? monitorTypeDicId,
    String? monitorTypeDicIdLabel,
    double? pressureDesign,
    double? pressureMax,
    String? pressureTypeDicId,
    String? pressureTypeDicIdLabel,
    String? ptInfo,
    double? reserves,
    String? riskObjectId,
    String? startDate,
    String? storeTypeDicId,
    String? storeTypeDicIdLabel,
    String? tankTypeDicId,
    String? tankTypeDicIdLabel,
    double? temperatureMax,
    double? temperatureMin,
    String? temperatureTypeDicId,
    String? temperatureTypeDicIdLabel,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? useDate,
    List<String>? filePath,
    String? isPressureVessel,
    String? havePressurePipeline,
    String? isBoiler,
    int? interlockingCount,
  }) {
    return HazardFacilityEntity()
      ..backupLinkAddress = backupLinkAddress ?? this.backupLinkAddress
      ..buildDate = buildDate ?? this.buildDate
      ..bypassSwitchTotalLocaleNo = bypassSwitchTotalLocaleNo ?? this.bypassSwitchTotalLocaleNo
      ..chemicalProcessTypeDicId = chemicalProcessTypeDicId ?? this.chemicalProcessTypeDicId
      ..chemicalProcessTypeDicIdLabel = chemicalProcessTypeDicIdLabel ?? this.chemicalProcessTypeDicIdLabel
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..designReserve = designReserve ?? this.designReserve
      ..deviceDetectionList = deviceDetectionList ?? this.deviceDetectionList
      ..equipCode = equipCode ?? this.equipCode
      ..equipDescribe = equipDescribe ?? this.equipDescribe
      ..equipLevel = equipLevel ?? this.equipLevel
      ..equipLevelLabel = equipLevelLabel ?? this.equipLevelLabel
      ..equipName = equipName ?? this.equipName
      ..equipStatus = equipStatus ?? this.equipStatus
      ..equipTypeDicId = equipTypeDicId ?? this.equipTypeDicId
      ..equipTypeDicIdLabel = equipTypeDicIdLabel ?? this.equipTypeDicIdLabel
      ..floorArea = floorArea ?? this.floorArea
      ..hazardCode = hazardCode ?? this.hazardCode
      ..id = id ?? this.id
      ..doubleerlockingCount = doubleerlockingCount ?? this.doubleerlockingCount
      ..latitude = latitude ?? this.latitude
      ..liquidLevel = liquidLevel ?? this.liquidLevel
      ..longitude = longitude ?? this.longitude
      ..mainSwitchStatusLocaleNo = mainSwitchStatusLocaleNo ?? this.mainSwitchStatusLocaleNo
      ..maintenanceDate = maintenanceDate ?? this.maintenanceDate
      ..manLinkAddress = manLinkAddress ?? this.manLinkAddress
      ..medium = medium ?? this.medium
      ..mediumStatusDicId = mediumStatusDicId ?? this.mediumStatusDicId
      ..mediumStatusDicIdLabel = mediumStatusDicIdLabel ?? this.mediumStatusDicIdLabel
      ..monitorGas = monitorGas ?? this.monitorGas
      ..monitorGasLabel = monitorGasLabel ?? this.monitorGasLabel
      ..monitorTypeDicId = monitorTypeDicId ?? this.monitorTypeDicId
      ..monitorTypeDicIdLabel = monitorTypeDicIdLabel ?? this.monitorTypeDicIdLabel
      ..pressureDesign = pressureDesign ?? this.pressureDesign
      ..pressureMax = pressureMax ?? this.pressureMax
      ..pressureTypeDicId = pressureTypeDicId ?? this.pressureTypeDicId
      ..pressureTypeDicIdLabel = pressureTypeDicIdLabel ?? this.pressureTypeDicIdLabel
      ..ptInfo = ptInfo ?? this.ptInfo
      ..reserves = reserves ?? this.reserves
      ..riskObjectId = riskObjectId ?? this.riskObjectId
      ..startDate = startDate ?? this.startDate
      ..storeTypeDicId = storeTypeDicId ?? this.storeTypeDicId
      ..storeTypeDicIdLabel = storeTypeDicIdLabel ?? this.storeTypeDicIdLabel
      ..tankTypeDicId = tankTypeDicId ?? this.tankTypeDicId
      ..tankTypeDicIdLabel = tankTypeDicIdLabel ?? this.tankTypeDicIdLabel
      ..temperatureMax = temperatureMax ?? this.temperatureMax
      ..temperatureMin = temperatureMin ?? this.temperatureMin
      ..temperatureTypeDicId = temperatureTypeDicId ?? this.temperatureTypeDicId
      ..temperatureTypeDicIdLabel = temperatureTypeDicIdLabel ?? this.temperatureTypeDicIdLabel
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..useDate = useDate ?? this.useDate
      ..filePath = filePath ?? this.filePath
      ..isPressureVessel = isPressureVessel ?? this.isPressureVessel
      ..havePressurePipeline = havePressurePipeline ?? this.havePressurePipeline
      ..isBoiler = isBoiler ?? this.isBoiler
      ..interlockingCount = interlockingCount ?? this.interlockingCount;
  }
}
